1. Field of the Invention
The present invention relates to a technique for reducing pseudo contours, which are generated on the occasion of changing bit precision in image tone quantization.
2. Description of the Related Art
Tone conversion is used for converting high-value bit precision to low-value bit precision or converting low-value bit precision to high-value bit precision. Among the conventional tone conversion methods, a simple bit-shifting method and an error diffusion method are known.
For instance, in a case where 16-bit-length signal sig16 is converted to 8-bit-length signal sig8 by bit shifting, the following calculation is simply performed.sig8=((unsigned long)sig16&0xFF00)>>8
In this case, since the lower bits are lost, a stepwise signal is formed as shown in FIG. 15. Further in this case, while values ranging from 0 to 255 in the 16-bit signal are converted to 0 in the 8-bit signal, only the value 65535 in the 16-bit signal is converted to 255 in the 8-bit signal. Since conversion cannot be performed evenly, colors also change. If the following calculation is performed to round the values, the lack of evenness is improved, but still the formed signal remains stepwise.sig8=((unsigned long)sig16+128)&0xFFF00)>>8
Meanwhile, an error diffusion method is known as a method of correcting pseudo contours which are generated in a case where tone quantization precision is low. When the error diffusion method is applied to conversion of 16-bit-length signal sig16 to 8-bit-length signal sig8, an error (err=sig16−sig8*256) generated in the conversion of 16-bit signal to 8-bit signal is diffused to peripheral pixels in a way that the local average values are uniform. However, this method has left a problem of persistent pseudo contours near the value ½ of converted one tone. There is a method which solves this problem (Japanese Patent No. 3399341). According to Japanese Patent No. 3399341, the way errors are given is changed in accordance with the tone level. However, both methods are adaptive processing where peripheral pixels are referred, and thus requiring relatively a large amount of branch instructions and calculations.
In a case where an object of shooting includes a blue sky or photographic gradation in a studio, changes in the tones are extremely gradual. When such object is photographed, in an often-used image where the tone quantization value is 8-bit length, there are cases that pseudo contours are generated and perceived as a tone jump in colors or luminance of the gradation part of the image. If this occurs particularly under a low-noise condition, for example, low ISO sensitivity, the pseudo contours can be reduced by improving the tone conversion method which is performed after image processing is performed at high-bit precision, for example, 16-bit length. Among the conventional tone conversion methods, bit shifting cannot solve the problem of pseudo contours, and error diffusion requires a large amount of calculations, a large circuit size, and a lot of processing time.